﻿* Encoding: UTF-8.
* Belief accuracy (standard scale) - higher values indicate more accurate beliefs

**Wave 1

RECODE BELIEFd_W1 (4=1) (3=2) (2=3) (1=4) (ELSE=COPY) INTO BELIEFd_W1r.
EXECUTE.

COMPUTE BAmes_W1 = (BELIEFa_W1 + BELIEFc_W1 + BELIEFd_W1r + BELIEFe_W1 + BELIEFf_W1)/5.
EXECUTE.
VAR LAB BAmes_W1 'Belief accuracy - Wave 1'.

RELIABILITY 
  /VARIABLES=BELIEFa_W1 BELIEFc_W1 BELIEFd_W1r BELIEFe_W1 BELIEFf_W1
  /SCALE('ALL VARIABLES') ALL 
  /MODEL=ALPHA.

**Wave 2

RECODE BELIEFd_W2 (4=1) (3=2) (2=3) (1=4) (ELSE=COPY) INTO BELIEFd_W2r.
EXECUTE.

COMPUTE BAmes_W2 = (BELIEFa_W2 + BELIEFc_W2 + BELIEFd_W2r + BELIEFe_W2 + BELIEFf_W2)/5.
EXECUTE.
VAR LAB BAmes_W2 'Belief accuracy - Wave 2'.

RELIABILITY 
  /VARIABLES=BELIEFa_W2 BELIEFc_W2 BELIEFd_W2r BELIEFe_W2 BELIEFf_W2
  /SCALE('ALL VARIABLES') ALL 
  /MODEL=ALPHA.

**Wave 3

RECODE BELIEFd_W3 (4=1) (3=2) (2=3) (1=4) (ELSE=COPY) INTO BELIEFd_W3r.
EXECUTE.

COMPUTE BAmes_W3 = (BELIEFa_W3 + BELIEFc_W3 + BELIEFd_W3r + BELIEFe_W3 + BELIEFf_W3)/6.
EXECUTE.
VAR LAB BAmes_W3 'Belief accuracy - Wave 3'.

RELIABILITY 
  /VARIABLES=BELIEFa_W3 BELIEFc_W3 BELIEFd_W3r BELIEFe_W3 BELIEFf_W3
  /SCALE('ALL VARIABLES') ALL 
  /MODEL=ALPHA.

COMPUTE BAmes_W1d = BAmes_W1/4.
COMPUTE BAmes_W2d = BAmes_W2/4.
COMPUTE BAmes_W3d = BAmes_W3/4.

COMPUTE BAmes_CH = BAmes_W2d - BAmes_W1d.
EXECUTE.

*Belief certainty

RECODE CERTAINa_W1 CERTAINc_W1 CERTAINd_W1 CERTAINe_W1 CERTAINf_W1 CERTAINg_W1 CERTAINh_W1 CERTAINi_W1 CERTAINj_W1 CERTAINk_W1 CERTAINl_W1 CERTAINm_W1
    CERTAINn_W1 CERTAINo_W1 CERTAINa_W2 CERTAINc_W2 CERTAINd_W2 CERTAINe_W2 CERTAINf_W2 CERTAINg_W2 CERTAINh_W2 CERTAINi_W2 CERTAINj_W2 CERTAINk_W2 
    CERTAINl_W2 CERTAINm_W2 CERTAINn_W2 CERTAINo_W2 CERTAINa_W3 CERTAINc_W3 CERTAINd_W3 CERTAINe_W3 CERTAINf_W3 CERTAINg_W3 CERTAINh_W3 CERTAINi_W3 
    CERTAINj_W3 CERTAINk_W3 CERTAINl_W3 CERTAINm_W3 CERTAINn_W3 CERTAINo_W3 (5=4).
EXECUTE.

*Wave 1

COMPUTE BC_W1 = (CERTAINa_W1 + CERTAINc_W1 + CERTAINd_W1 + CERTAINe_W1 + CERTAINf_W1)/6.
EXECUTE.
VAR LAB BC_W1 'Belief certainty - Wave 1'.

RELIABILITY 
  /VARIABLES=CERTAINa_W1 CERTAINc_W1 CERTAINd_W1 CERTAINe_W1 CERTAINf_W1
  /SCALE('ALL VARIABLES') ALL 
  /MODEL=ALPHA.

*Wave 2

COMPUTE BC_W2 = (CERTAINa_W2 + CERTAINc_W2 + CERTAINd_W2 + CERTAINe_W2 + CERTAINf_W2)/6.
EXECUTE.
VAR LAB BC_W2 'Belief certainty - Wave 2'.

RELIABILITY 
  /VARIABLES=CERTAINa_W2 CERTAINc_W2 CERTAINd_W2 CERTAINe_W2 CERTAINf_W2
  /SCALE('ALL VARIABLES') ALL 
  /MODEL=ALPHA.

* Wave 3

COMPUTE BC_W3 = (CERTAINa_W3 + CERTAINc_W3 + CERTAINd_W3 + CERTAINe_W3 + CERTAINf_W3)/6.
EXECUTE.
VAR LAB BC_W3 'Belief certainty - Wave 3'.

RELIABILITY 
  /VARIABLES=CERTAINa_W3 CERTAINc_W3 CERTAINd_W3 CERTAINe_W3 CERTAINf_W3
  /SCALE('ALL VARIABLES') ALL 
  /MODEL=ALPHA.
 
RECODE BELIEFa_W1 BELIEFc_W1 BELIEFd_W1r BELIEFe_W1 BELIEFf_W1
    BELIEFa_W2 BELIEFc_W2 BELIEFd_W2r BELIEFe_W2 BELIEFf_W2
    BELIEFa_W3 BELIEFc_W3 BELIEFd_W3r BELIEFe_W3 BELIEFf_W3
    (1 THRU 2=-1) (3 THRU 4=1) INTO RIGHTa_W1 RIGHTc_W1 RIGHTd_W1 RIGHTe_W1 RIGHTf_W1
    RIGHTa_W2 RIGHTc_W2 RIGHTd_W2 RIGHTe_W2 RIGHTf_W2
    RIGHTa_W3 RIGHTc_W3 RIGHTd_W3 RIGHTe_W3 RIGHTf_W3.
EXECUTE.

RECODE CERTAINa_W1 CERTAINc_W1 CERTAINd_W1 CERTAINe_W1 CERTAINf_W1
    CERTAINa_W2 CERTAINc_W2 CERTAINd_W2 CERTAINe_W2 CERTAINf_W2
    CERTAINa_W3 CERTAINc_W3 CERTAINd_W3 CERTAINe_W3 CERTAINf_W3
    (5=4) (ELSE=COPY).
EXECUTE.

USE ALL.

COMPUTE CERTAINs_W1 = (CERTAINa_W1 + CERTAINc_W1 + CERTAINd_W1 + CERTAINe_W1 + CERTAINf_W1)/5.
EXECUTE.

RELIABILITY 
  /VARIABLES=CERTAINa_W1 CERTAINc_W1 CERTAINd_W1 CERTAINe_W1 CERTAINf_W1
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

COMPUTE BEL_CERa_W1 = RIGHTa_W1*CERTAINa_W1.
COMPUTE BEL_CERc_W1 = RIGHTc_W1*CERTAINc_W1.
COMPUTE BEL_CERd_W1 = RIGHTd_W1*CERTAINd_W1.
COMPUTE BEL_CERe_W1 = RIGHTe_W1*CERTAINe_W1.
COMPUTE BEL_CERf_W1 = RIGHTf_W1*CERTAINf_W1.

COMPUTE BEL_CERa_W2 = RIGHTa_W2*CERTAINa_W2.
COMPUTE BEL_CERc_W2 = RIGHTc_W2*CERTAINc_W2.
COMPUTE BEL_CERd_W2 = RIGHTd_W2*CERTAINd_W2.
COMPUTE BEL_CERe_W2 = RIGHTe_W2*CERTAINe_W2.
COMPUTE BEL_CERf_W2 = RIGHTf_W2*CERTAINf_W2.

COMPUTE BEL_CERa_W3 = RIGHTa_W3*CERTAINa_W3.
COMPUTE BEL_CERc_W3 = RIGHTc_W3*CERTAINc_W3.
COMPUTE BEL_CERd_W3 = RIGHTd_W3*CERTAINd_W3.
COMPUTE BEL_CERe_W3 = RIGHTe_W3*CERTAINe_W3.
COMPUTE BEL_CERf_W3 = RIGHTf_W3*CERTAINf_W3.

RECODE BEL_CERa_W1 BEL_CERc_W1 BEL_CERd_W1 BEL_CERe_W1 BEL_CERf_W1
    BEL_CERa_W2 BEL_CERc_W2 BEL_CERd_W2 BEL_CERe_W2 BEL_CERf_W2
    BEL_CERa_W3 BEL_CERc_W3 BEL_CERd_W3 BEL_CERe_W3 BEL_CERf_W3
    (-4 THRU -3 = 0) (SYSMIS=SYSMIS) (ELSE = 1) INTO BEL_CERa_W1d BEL_CERc_W1d BEL_CERd_W1d BEL_CERe_W1d BEL_CERf_W1d
    BEL_CERa_W2d BEL_CERc_W2d BEL_CERd_W2d BEL_CERe_W2d BEL_CERf_W2d
    BEL_CERa_W3d BEL_CERc_W3d BEL_CERd_W3d BEL_CERe_W3d BEL_CERf_W3d.
EXECUTE.

RECODE BEL_CERa_W1 BEL_CERc_W1 BEL_CERd_W1 BEL_CERe_W1 BEL_CERf_W1
    BEL_CERa_W2 BEL_CERc_W2 BEL_CERd_W2 BEL_CERe_W2 BEL_CERf_W2
    BEL_CERa_W3 BEL_CERc_W3 BEL_CERd_W3 BEL_CERe_W3 BEL_CERf_W3
    (-4 = 0) (SYSMIS=SYSMIS) (ELSE = 1) INTO BEL_CERa_W1da BEL_CERc_W1da BEL_CERd_W1da BEL_CERe_W1da BEL_CERf_W1da
    BEL_CERa_W2da BEL_CERc_W2da BEL_CERd_W2da BEL_CERe_W2da BEL_CERf_W2da
    BEL_CERa_W3da BEL_CERc_W3da BEL_CERd_W3da BEL_CERe_W3da BEL_CERf_W3da.
EXECUTE.

COMPUTE RT_CT_W1 = (BEL_CERa_W1d  + BEL_CERc_W1d + BEL_CERd_W1d + BEL_CERe_W1d + BEL_CERf_W1d)/5.
COMPUTE RT_CT_W2 = (BEL_CERa_W2d + BEL_CERc_W2d + BEL_CERd_W2d + BEL_CERe_W2d + BEL_CERf_W2d)/5.
COMPUTE RT_CT_W3 = (BEL_CERa_W3d + BEL_CERc_W3d + BEL_CERd_W3d + BEL_CERe_W3d + BEL_CERf_W3d)/5.
EXECUTE.

COMPUTE RT_CT_W1a = (BEL_CERa_W1da + BEL_CERc_W1da + BEL_CERd_W1da + BEL_CERe_W1da + BEL_CERf_W1da)/5.
COMPUTE RT_CT_W2a = (BEL_CERa_W2da + BEL_CERc_W2da + BEL_CERd_W2da + BEL_CERe_W2da + BEL_CERf_W2da)/5.
COMPUTE RT_CT_W3a = (BEL_CERa_W3da + BEL_CERc_W3da + BEL_CERd_W3da + BEL_CERe_W3da + BEL_CERf_W3da)/5.
EXECUTE.

COMPUTE RT_CT_CH = RT_CT_W2 - RT_CT_W1.
COMPUTE RT_CT_CHa = RT_CT_W2a - RT_CT_W1a.
EXECUTE.

RECODE BEL_CERa_W1 BEL_CERc_W1 BEL_CERd_W1 BEL_CERe_W1 BEL_CERf_W1 
    BEL_CERa_W2 BEL_CERc_W2 BEL_CERd_W2 BEL_CERe_W2 BEL_CERf_W2 (-4=-3) (-3=-2) (-2=-1) (-1=0) (1=0) (2=1) (3=2) (4=3) (ELSE=COPY) INTO
    BEL_CERa_W1r BEL_CERc_W1r BEL_CERd_W1r BEL_CERe_W1r BEL_CERf_W1r 
    BEL_CERa_W2r BEL_CERc_W2r BEL_CERd_W2r BEL_CERe_W2r BEL_CERf_W2r.
EXECUTE.

COMPUTE BEL_CERa_CH = BEL_CERa_W2r - BEL_CERa_W1r.
COMPUTE BEL_CERc_CH = BEL_CERc_W2r - BEL_CERc_W1r.
COMPUTE BEL_CERd_CH = BEL_CERd_W2r - BEL_CERd_W1r.
COMPUTE BEL_CERe_CH = BEL_CERe_W2r - BEL_CERe_W1r.
COMPUTE BEL_CERf_CH = BEL_CERf_W2r - BEL_CERf_W1r.

COMPUTE BCERT_W1 = (BEL_CERa_W1r + BEL_CERc_W1r + BEL_CERd_W1r + BEL_CERe_W1r + BEL_CERf_W1r)/5.
COMPUTE BCERT_W2 = (BEL_CERa_W2r + BEL_CERc_W2r + BEL_CERd_W2r + BEL_CERe_W2r + BEL_CERf_W2r)/5.
COMPUTE BCERT_CH = BCERT_W2-BCERT_W1.
 
COMPUTE BCERT_W1d = BCERT_W1/3.
COMPUTE BCERT_W2d = BCERT_W2/3.
COMPUTE BCERT_CHd = BCERT_W2d-BCERT_w1d.
EXECUTE.

*Treatment

RECODE COND_W1 (1=0) (2=1) (3=1) INTO CORR_W1.
RECODE COND_W2 (1=0) (2=1) (3=1) INTO CORR_W2.
EXECUTE.
COMPUTE CORR_W1xW2 = CORR_W1*CORR_W2.
EXECUTE.

*Placebo items

COMPUTE EXPOSEpl = (PRIORk_W1 + PRIORl_W1 + PRIORn_W1 + PRIORo_W1)/4.
EXECUTE.

COMPUTE EXPOSEplz = EXPOSEpl-1.
EXECUTE.

RECODE CERTAINk_W1 CERTAINl_W1 CERTAINm_W1 CERTAINn_W1 CERTAINo_W1 (5=4) (ELSE=COPY).
EXECUTE.

COMPUTE CERTAINpl = (CERTAINk_W1 + CERTAINl_W1 + CERTAINm_W1 + CERTAINn_W1 + CERTAINo_W1)/5.
EXECUTE.

RECODE BELIEFl_W1 (1=4) (2=3) (3=2) (1=4) (ELSE=COPY) INTO BELIEFl_W1r.
EXECUTE.

COMPUTE BELIEFpl = (BELIEFk_W1 + BELIEFl_W1r + BELIEFm_W1 + BELIEFn_W1 + BELIEFo_W1)/5.
EXECUTE.

COMPUTE CORR1xBEp = (CORR_W1*BELIEFpl).
COMPUTE CORR2xBEp = (CORR_W2*BELIEFpl).
EXECUTE.

COMPUTE CORR1xCER = (CORR_W1*CERTAINpl).
COMPUTE CORR2xCER = (CORR_W2*CERTAINpl).
EXECUTE.

RELIABILITY 
  /VARIABLES=PRIORk_W1 PRIORl_W1 PRIORn_W1 PRIORo_W1
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

RELIABILITY 
  /VARIABLES=CERTAINk_W1 CERTAINl_W1 CERTAINm_W1 CERTAINn_W1 CERTAINo_W1
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

*Treatment

RECODE COND_W1 (1=0) (2=1) (3=1) INTO CORR_W1.
RECODE COND_W2 (1=0) (2=1) (3=1) INTO CORR_W2.
EXECUTE.
COMPUTE CORR_W1xW2 = CORR_W1*CORR_W2.
EXECUTE.

*Illegal immigration attitudes - recoded such that higher values indicate more positive feelings toward illegal immigrants

**Wave 1

RECODE ATT4_1_1 ATT4_1_3 ATT4_1_5 ATT4_1_8 (7=1) (6=2) (5=3) (4=4) (3=5) (2=6) (1=7) (ELSE=COPY) INTO ATT4_1_1r ATT4_1_3r ATT4_1_5r ATT4_1_8r.
EXECUTE.

COMPUTE ILL_ATT_W1 = (ATT4_1_1r + ATT4_1_2 + ATT4_1_3r + ATT4_1_4 + ATT4_1_5r + ATT4_1_6 + ATT4_1_7 + ATT4_1_8r + ATT4_1_9 + ATT4_1_10)/10.
EXECUTE.
VAR LAB ILL_ATT_W1 'Illegal immigration attitudes - Wave 1'.

RELIABILITY 
  /VARIABLES=ATT4_1_2 ATT4_1_4 ATT4_1_6 ATT4_1_7 ATT4_1_9 ATT4_1_10 ATT4_1_1r ATT4_1_3r ATT4_1_5r 
    ATT4_1_8r 
  /SCALE('ALL VARIABLES') ALL 
  /MODEL=ALPHA.

**Wave 2

RECODE ATT4_2_1 ATT4_2_3 ATT4_2_5 ATT4_2_8 (7=1) (6=2) (5=3) (4=4) (3=5) (2=6) (1=7) (ELSE=COPY) INTO ATT4_2_1r ATT4_2_3r ATT4_2_5r ATT4_2_8r.
EXECUTE.

COMPUTE ILL_ATT_W2 = (ATT4_2_1r + ATT4_2_2 + ATT4_2_3r + ATT4_2_4 + ATT4_2_5r + ATT4_2_6 + ATT4_2_7 + ATT4_2_8r + ATT4_2_9 + ATT4_2_10)/10.
EXECUTE.
VAR LAB ILL_ATT_W2 'Illegal immigration attitudes - Wave 2'.

RELIABILITY 
  /VARIABLES=ATT4_2_2 ATT4_2_4 ATT4_2_6 ATT4_2_7 ATT4_2_9 ATT4_2_10 ATT4_2_1r ATT4_2_3r ATT4_2_5r 
    ATT4_2_8r 
  /SCALE('ALL VARIABLES') ALL 
  /MODEL=ALPHA.

**Wave 3

RECODE ATT4_3_1 ATT4_3_3 ATT4_3_5 ATT4_3_8 (7=1) (6=2) (5=3) (4=4) (3=5) (2=6) (1=7) (ELSE=COPY) INTO ATT4_3_1r ATT4_3_3r ATT4_3_5r ATT4_3_8r.
EXECUTE.

COMPUTE ILL_ATT_W3 = (ATT4_3_1r + ATT4_3_2 + ATT4_3_3r + ATT4_3_4 + ATT4_3_5r + ATT4_3_6 + ATT4_3_7 + ATT4_3_8r + ATT4_3_9 + ATT4_3_10)/10.
EXECUTE.
VAR LAB ILL_ATT_W3 'Illegal immigration attitudes - Wave 3'.

RELIABILITY 
  /VARIABLES=ATT4_3_2 ATT4_3_4 ATT4_3_6 ATT4_3_7 ATT4_3_9 ATT4_3_10 ATT4_3_1r ATT4_3_3r ATT4_3_5r 
    ATT4_3_8r 
  /SCALE('ALL VARIABLES') ALL 
  /MODEL=ALPHA.

*Party ID and ideology

**Republican dummy

RECODE PARTY1 (8=1) (ELSE=0) INTO REPd.
EXECUTE.
VAR LAB REPd 'Republican dummy'.

**Democrat dummy

RECODE PARTY1 (4=1) (ELSE=0) INTO DEMd.
EXECUTE.
VAR LAB DEMd 'Democrat dummy'.

**Partisan strength dummy (high=1)

RECODE PARTY2 (1=1) (ELSE=0) INTO IDstr.
EXECUTE.
VAR LAB IDstr 'Partisan strength dummy'.

**Ideology - higher values indicate more conservative lean

RECODE IDEO (8=SYSMIS) (ELSE=COPY) INTO IDEOLOGY.
EXECUTE.
VAR LAB IDEOLOGY 'Self-reported political ideology'.

*Race

RECODE RACE (2=1) (ELSE=0) INTO BLACK.
RECODE RACE (3=1) (ELSE=0) INTO LATINO.
EXECUTE.




